package com.rentcars.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.rentcars.entity.Cars;
import com.rentcars.entity.Cliencompany;
import com.rentcars.entity.Clientuser;
import com.rentcars.entity.Dept;
import com.rentcars.mapper.RentalCarMapper;
import com.rentcars.service.RentalcarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 罗孝天
 */
@Service("rentalcarService")
public class RentalcarServiceImpl implements RentalcarService {

    @Autowired
    private RentalCarMapper rentalCarMapper;


    @Override
    public void insertRentalCar(Clientuser user, Cliencompany company, String uId) {
        rentalCarMapper.insertCompany(company);
        rentalCarMapper.updateUser(user, uId);
    }

    @Override
    public List searchCars() {
        return rentalCarMapper.searchCars();
    }

    @Override
    public List<Dept> searchDept() {
        return rentalCarMapper.searchDept();
    }

    @Override
    public String getDeptAddress(String deptName) {
        String address=rentalCarMapper.getDeptAddress(deptName);
        return address;
    }

    @Override
    public Cars getCarInfo(String carid) {
        Cars cars=rentalCarMapper.getCarInfo(carid);
        return cars;
    }
}
